from interface.member import MemberInterface
from utils.get_keyword import GetKeyword
from utils.request_method import SendMethod
from utils.mysql_tools import DBtools


class ComfirmOrder:

    def __init__(self,headers):
        self.url='http://47.108.206.100:8085'
        self.headers = headers # 获取登录的用户令牌

        # 添加收货地址
    def add_address(self, params):
        method = 'post'
        url = self.url + '/member/address/add'
        return SendMethod.send_method(method, url, json=params, headers=self.headers)

        # 获取收货地址详情
    def get_address_info(self):
        method = 'get'
        url = self.url + '/member/address/3962'
        return SendMethod.send_method(method, url, headers=self.headers)

        # 确认订单
    def comfirm_order(self, body):
        method = 'post'
        url = self.url + '/order/generateConfirmOrder'
        playload = [body]
        return SendMethod.send_method(method, url, json=playload, headers=self.headers)



